package server.communication.ClientMessages;

import java.io.IOException;

import server.communication.Client;
import server.communication.MessageProcessor;

public class ClientDetailsMessageThread extends ClientMessageThread{

	public ClientDetailsMessageThread(Client parent) throws IOException
	{
		super (parent);
	}
	
	@Override
	public void run()
	{
		String query = MessageProcessor.getOSQuery();
		out.println(query);
		String input;
		dontPauseNow();
		try
		{
			input = in.readLine();
			input = parent.getMessageProcessor().process(input);
			if (input != null && !input.equals("unknown"))
				out.println(input);
		}
		catch(IOException e)
		{
			System.err.println("Error while reading the answer for ClientDetails");
			e.printStackTrace();
		}
		pauseOK();
		parent.removeMessageThread(this);
	}
}
